#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'

int main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int m; cin >> m;
	int i = 1, j = 1, sum = 1;
	while (i <= m / 2) {
		if (sum < m) {
			j++;
			sum += j;
		}else if (sum > m) {
			sum -= i;
			i++;
		}else {
			cout << i << " " << j << endl;
			sum -= i;
			i++;
		}
	}
	return 0;
}